<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<div fxLayout="column"
     fxFill
     fxFlexFill>
  <mat-toolbar class="kd-toolbar kd-primary-toolbar">
    <div class="kd-toolbar-tools"
         fxLayout="row"
         fxFlex="auto">
      <div class="kd-logo-bar">
        <a [routerLink]="getWorkloadsStateName()"
           queryParamsHandling="preserve"
           class="kd-toolbar-logo-link">
          <mat-icon [svgIcon]="assets.getAppLogo()"
                    class="kd-toolbar-logo">
          </mat-icon>
          <mat-icon [svgIcon]="assets.getAppLogoText()"
                    class="kd-toolbar-logo-text">
          </mat-icon>
        </a>
      </div>
      <kd-namespace-selector id="nav-namespace-selector">
      </kd-namespace-selector>

      <kd-search class="kd-search-bar"
                 fxFlex>
      </kd-search>
      <div fxLayout="row">
        <button mat-icon-button
                color="primary"
                class="kd-toolbar-action"
                i18n-matTooltip
                matTooltip="Create new resource"
                (click)="goToCreateState()">
          <mat-icon class="kd-primary-toolbar-icon">add</mat-icon>
        </button>
        <kd-notifications class="kd-toolbar-action"></kd-notifications>
        <kd-user-panel class="kd-toolbar-action"></kd-user-panel>
      </div>
    </div>
  </mat-toolbar>

  <mat-toolbar class="kd-second-toolbar kd-bg-primary">
    <div class="kd-toolbar-tools"
         fxFlex>
      <kd-nav-hamburger fxFlex="none"></kd-nav-hamburger>
      <kd-breadcrumbs class="kd-actionbar-breadcrumbs"></kd-breadcrumbs>
      <kd-actionbar fxFlex="end"></kd-actionbar>
    </div>
  </mat-toolbar>

  <mat-toolbar class="kd-system-banner"
               [ngClass]="getSystemBannerClass()"
               *ngIf="isSystemBannerVisible()"
               [innerHTML]="getSystemBannerMessage()">
  </mat-toolbar>

  <div fxFlex
       fxLayout="row"
       class="kd-chrome-container kd-bg-background">
    <kd-nav></kd-nav>
    <div [ngSwitch]="loading"
         fxLayoutAlign="center"
         fxFlex
         class="kd-scroll-container">
      <div *ngSwitchCase="true"
           fxFlexAlign="center">
        <mat-spinner mode="indeterminate"
                     [diameter]="48">
        </mat-spinner>
      </div>
      <div *ngSwitchCase="false"
           fxFlex
           class="kd-scroll-container">
        <router-outlet></router-outlet>
      </div>
    </div>
  </div>
</div>
